<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//4. 使用面向对象思想模拟生活中的继承情况。需要声明父类、子类、属性和相关方法，子类不少于2个，属性不少于5个，方法不少2个。
			//姓名，性别，年龄，
			function Base(name, age, identity, where) {
				this.name = name;
				this.age = age;
				this.identity = identity;	
				this.where = where;
			}
			
			function F() {} 
			F.prototype = Base.prototype; 
			
			function Human1(name, age, identity, where, donu) {
				Base.call(this, name, age, identity, where); 
				this.donu = donu;
			}
			function Human2(name, age, identity, where, wchig) {
				Base.call(this, name, age, identity, where); 
				this.wchig = wchig;
			}
			function Human3(name, age, identity, where, cooIC) {
				Base.call(this, name, age, identity, where); 
				this.cooIC = cooIC;
			}
			
			Base.prototype.desc = function() { 
				console.log("姓名：" + this.name + "，年龄：" + this.age + "，身份：" + this.identity + "，在"+ this.where  + this.donu);
			}
			Base.prototype.desc1 = function() { 
				console.log("姓名：" + this.name + "，年龄：" + this.age + "，身份：" + this.identity +  "，在"+ this.where  + this.wchig);
			}
			Base.prototype.desc2 = function() { 
				console.log("姓名：" + this.name + "，年龄：" + this.age + "，身份：" + this.identity +  "，在"+ this.where  + this.cooIC);
			}
			
			Human1.prototype = new F();
			Human1.prototype.constructor = Human1; 
			
			Human2.prototype = new F();
			Human2.prototype.constructor = Human2;
			
			Human3.prototype = new F();
			Human3.prototype.constructor = Human3; 
			
			let human1 = new Human1("艾达", 18, "科技研究助理", "科研室做", "实验学习");
			console.log("human1", human1);
			human1.desc();
			
			let human2 = new Human2("利穆沙", 40, "技术博士", "科展室", "代领学员实践");
			console.log("human2", human2);
			human2.desc1();
			
			let human3 = new Human3("多尼娜", 25, "测试调研员", "实践IC大厅", "进行ICo测试");
			console.log("human3", human3);
			human3.desc2();
		</script>
	</body>
</html>
